//***************************************************************************
// Project:   MDT 2010 Lite Touch Wizard Editor
// File:      ChooseType.cs
// Purpose:   Display a simple dialog for choosing the type of item to add.
//
// Version:   2.0.0
//
// Change history:
// 1.0.1  mniehaus  06/25/2008  Cleaned up and commented code for external
//                              release.
// 2.0.0  mniehaus  10/11/2009  Fixed FXCop warnings.
//
//***************************************************************************

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WizardEditor
{
    /// <summary>
    /// The ChooseType form is used to specify the type of object that should be created.  This form is used by the
    /// main form.
    /// </summary>
    public partial class ChooseType : Form
    {
        /// <summary>
        /// Default constructor (used by designer)
        /// </summary>
        public ChooseType()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Constructor (used by MainForm)
        /// </summary>
        /// <param name="nodeType">The node type currently selected (used to restrict the types presented)</param>
        public ChooseType(String nodeType)
        {
            InitializeComponent();

            if (nodeType == "Global")
            {
                // No condition entry for global
                cbTypeToAdd.Items.RemoveAt(cbTypeToAdd.Items.Count - 1);
            }
        }

        /// <summary>
        /// The SelectedType property returns the type value chosen from the drop-down list.
        /// </summary>
        public String SelectedType
        {
            get
            {
                return cbTypeToAdd.SelectedItem.ToString();
            }
        }
    }
}